<?php
/**
 * 
 *
 */
class Maverick_Controller_Config{
	
	protected $_controller;
	
	protected $_config;
	
	public function __construct(Zend_Controller_Front $controller,$configpath){
		$this->_controller = $controller;
		
		//$this->_controller->addModuleDirectory('../modules');
		$config = new Zend_Config_ini('../application/config.ini','modules');
		$modules = explode(", ",$config->modules);
		if ($modules){
			 foreach ($modules as $module){
			 	$this->_controller->addControllerDirectory('../application/modules/'.$module.'/controllers', $module);
				set_include_path('../application/modules/'.$module.'/models' . PATH_SEPARATOR . get_include_path());
			 }
		}
		set_include_path('../modules/default/views/scripts' . PATH_SEPARATOR . get_include_path());

		if ($config->default){
			$this->_controller->setDefaultModule($config->default);
		}else {
			$this->_controller->setDefaultModule('page');
		}
	}
}
?>